package com.luom.springbootinit.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.luom.springbootinit.model.dto.borrowRecord.BorrowRecordQueryRequest;
import com.luom.springbootinit.model.entity.BorrowRecord;
import com.luom.springbootinit.model.vo.BorrowRecordVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 28713
* @description 针对表【borrow_record(借书还书记录)】的数据库操作Mapper
* @createDate 2024-09-07 21:28:22
* @Entity generator.domain.BorrowRecord
*/
public interface BorrowRecordMapper extends BaseMapper<BorrowRecord> {

    @Select("select count(*) count from bms.borrow_record where bookId = #{bookId}")
    Integer getBookCount(Integer bookId);

    List<BorrowRecordVO> getPage(BorrowRecordQueryRequest borrowRecordQueryRequest);

    /**
     * 批量更新
     * @return
     */
    int updateBatchById(List<Integer> ids);
}




